using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.ICM
{
	[DataContract, Table("IcmMasResourceItem")]
    public class MasResourceItem
    {
        public MasResourceItem()
        {
            //this.PrePurchaseRequestItems = new HashSet<PrePurchaseRequestItem>();
        }
    
		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "ResItemId", ResourceType = typeof(Resources.MasResourceItemResource))]
        public int ResItemId { get; set; }

        [DataMember, Display(Name = "Code", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string Code { get; set; }

        [DataMember, Display(Name = "OldCode", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string OldCode { get; set; }

        [DataMember, Display(Name = "Name", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string Name { get; set; }

        [DataMember, Display(Name = "Descr", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string Descr { get; set; }

		[ForeignKey("MasResourceSubGroup")]
		[DataMember, Display(Name = "ResSubGrpId", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<int> ResSubGrpId { get; set; }

		[DataMember, Display(Name = "GpscCode", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string GpscCode { get; set; }

		[DataMember, Display(Name = "GiinCode", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string GiinCode { get; set; }

		[DataMember, Display(Name = "StdPrice", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<double> StdPrice { get; set; }

		[DataMember, Display(Name = "MinPrice", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<double> MinPrice { get; set; }

		[DataMember, Display(Name = "MaxPrice", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<double> MaxPrice { get; set; }

		[ForeignKey("MasUnit")]
		[DataMember, Display(Name = "UnitId", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<int> UnitId { get; set; }

		[DataMember, Display(Name = "MinQty", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<int> MinQty { get; set; }

		[DataMember, Display(Name = "MaxQty", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<int> MaxQty { get; set; }

		[DataMember, Display(Name = "ImageName", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string ImageName { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.MasResourceItemResource))]
        public string RecordStatus { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.MasResourceItemResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        //[DataMember]
        //public virtual ICollection<PrePurchaseRequestItem> PrePurchaseRequestItems { get; set; }

		[DataMember]
        public virtual MasResourceSubGroup MasResourceSubGroup { get; set; }

		[DataMember]
        public virtual MasUnit MasUnit { get; set; }

    }
}